﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for ItemManager
/// </summary>
public class FinderManager
{
	public FinderManager()
	{
	}

    public static ERPSIA.ItemStoreRoomInfo GetStoreInfo(ERPSIA.Item item, ERPSIA.StoreRoom store)
    {
        foreach (ERPSIA.ItemStoreRoomInfo storeInfo in item.StoreInfo)
            if (storeInfo.StoreRoom.Id == store.Id)
                return storeInfo;
        return null;
    }

    public static ERPSIA.StoreRoom GetStore(int storeId, ERPSIA.StoreRoom[] stores)
    {
        foreach (ERPSIA.StoreRoom store in stores)
            if (store.Id == storeId)
                return store;
        return null;
    }

    public static ERPSIA.Item GetItem(int itemId, ERPSIA.Item[] items)
    {
        foreach (ERPSIA.Item item in items)
            if (item.Id == itemId)
                return item;
        return null;
    }

    public static ERPSIA.AuxiliarAccount GetClient(int clientId, ERPSIA.AuxiliarAccount[] clients)
    {
        foreach (ERPSIA.AuxiliarAccount client in clients)
            if (client.AccountID == clientId)
                return client;
        return null;
    }
}